home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 25
/
AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso
/
Updates
/
PowerPC
/
pdflib
/
bind
/
tcl
/
hello.tcl
next >
Wrap
Text File
|
2000-05-16
|
916b
|
45 lines
#!/bin/sh
# hello.tcl
# Copyright (C) 1997-99 Thomas Merz. All rights reserved.
#
# PDFlib client: hello example in Tcl
#
# Hide the exec to TCL but not to the shell by appending a backslash\
exec tclsh "$0" ${1+"$@"}
# The lappend line is unnecessary if PDFlib has been installed
# in the Tcl package directory
lappend auto_path .
package require pdflib 2.01
set p [PDF_new]
if {[PDF_open_file $p "hello_tcl.pdf"] == -1} {
puts stderr "Couldn't open PDF file!"
exit
}
PDF_set_info $p "Creator" "hello.tcl"
PDF_set_info $p "Author" "Thomas Merz"
PDF_set_info $p "Title" "Hello world (Tcl)"
PDF_begin_page $p 595 842
set font [PDF_findfont $p Helvetica-Bold "default" 0 ]
if { $font == -1 } {
puts stderr "Couldn't set font!"
exit
}
PDF_setfont $p $font 18.0
PDF_set_text_pos $p 50 700
PDF_show $p "Hello world!"
PDF_continue_text $p "(says Tcl)"
PDF_end_page $p
PDF_close $p
PDF_delete $p